package my.graduation.controller.admin;

import my.graduation.dto.DoctorInfoDto;
import my.graduation.dto.ExamItemDto;
import my.graduation.result.Result;
import my.graduation.service.ExaminationItemService;
import my.graduation.vo.DoctorVO;
import my.graduation.vo.ExaminationItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: RavenLyn
 * @Date: 2025-02-28
 */
@RestController
@RequestMapping("/admin/exam_item")
public class AdminExamItemController {
    @Autowired
    private ExaminationItemService examItemService;

    /**
     * 获取检查项目信息
     * @return
     */
    @GetMapping
    public Result<List<ExaminationItemVO>> list(){
        return examItemService.getVOList();
    }

    /**
     * 条件获取检查项目信息
     * @param dto
     * @return
     */
    @PostMapping("/con")
    public Result<List<ExaminationItemVO>> list(@RequestBody DoctorInfoDto dto){
        return examItemService.getVOListByCon(dto);
    }

    /**
     * 新增检查项目信息
     * @return
     */
    @PostMapping
    public Result add(@RequestBody ExamItemDto dto){
        return examItemService.add(dto);
    }

    /**
     * 修改检查项目信息
     * @return
     */
    @PutMapping
    public Result update(@RequestBody ExamItemDto dto){
        return examItemService.update(dto);
    }

    /**
     * 删除检查项目信息
     * @return
     */
    @DeleteMapping
    public Result delete(@RequestBody ExamItemDto dto){
        return examItemService.delete(dto);
    }



}
